﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using DongleManage.Model.BaseClass;
using System.Data;

namespace DongleManage.Model.Common
{

		
	/// <summary>
	///  消息中心.
	/// </summary>
	/// <remarks>
	/// 该实体由工具生成，尽量不要手动修改
	/// </remarks>
	[DataContract]
	public partial class MessageCenterEntity :BaseEntity
	{
		#region 属性、变量声明
		#region 主属性 --对应数据表主键
		/// <summary>			
		/// ID : 
		/// </summary>
		/// <remarks>表MessageCenter主键</remarks>
		[DisplayName("ID")]
		[DataMember]
		public long ID
        {
            get;
            set;
        }
		#endregion
		
		#region 属性
		
		/// <summary>
		/// 消息类型：1:系统消息；2：广告；3：私人消息；4：验证消息
		/// </summary>
        [DisplayName("1:系统消息；2：广告；3：私人消息；4：验证消息")]
        
		[DataMember]
		public Int32? MessageType
        {
            get;
            set;
        }
		
		/// <summary>
		/// 消息内容
		/// </summary>
        [DisplayName("")]
        [StringLength(256, ErrorMessage = "请勿输入超过 256 个字!")]
        
		[DataMember]
        public String MessageContent
        {
            get;
            set;
        }
		
		/// <summary>
		/// 发送日期 
		/// </summary>
        [DisplayName("")]
        
		[DataMember]
		public DateTime? SendDate
        {
            get;
            set;
        }
		
		/// <summary>
		/// 已读日期 
		/// </summary>
        [DisplayName("")]
        
		[DataMember]
		public DateTime? ReadDate
        {
            get;
            set;
        }
		
		/// <summary>
		/// 操作状态 : 0:未处理；1：已阅读；2：同意；3拒绝
		/// </summary>
        [DisplayName("0:未处理；1：已阅读；2：同意；3拒绝")]
        
		[DataMember]
		public Int32? Opation
        {
            get;
            set;
        }
		
		/// <summary>
		/// 操作日期
		/// </summary>
        [DisplayName("")]
        
		[DataMember]
		public DateTime? OpationDate
        {
            get;
            set;
        }
		
		/// <summary>
		/// 消息来源ID
		/// </summary>
        [DisplayName("")]
        
		[DataMember]
		public Int32? FromSource
        {
            get;
            set;
        }
		
		/// <summary>
		/// 接收目标
		/// </summary>
        [DisplayName("接收目标")]
        
		[DataMember]
		public Int32? Target
        {
            get;
            set;
        }
		#endregion

		#endregion 属性、变量声明

        public MessageCenterEntity(IDataReader dataReader)
            : base(dataReader)
        {
            ID = Convert.IsDBNull(dataReader["ID"]) ? 0 : Convert.ToInt64(dataReader["ID"]);
            MessageType = Convert.IsDBNull(dataReader["MessageType"]) ? null :dataReader["MessageType"] as int?;
            MessageContent = Convert.IsDBNull(dataReader["MessageContent"]) ? "" : Convert.ToString(dataReader["MessageContent"]);
            SendDate = Convert.IsDBNull(dataReader["SendDate"]) ? null : dataReader["SendDate"] as DateTime?;;
            ReadDate = Convert.IsDBNull(dataReader["ReadDate"]) ? null : dataReader["ReadDate"] as DateTime?; 
            Opation = Convert.IsDBNull(dataReader["Opation"]) ? null : dataReader["Opation"] as int?; 
            OpationDate = Convert.IsDBNull(dataReader["OpationDate"]) ? null : dataReader["OpationDate"] as DateTime?;
            FromSource = Convert.IsDBNull(dataReader["FromSource"]) ? null : dataReader["FromSource"] as int?;
            Target = Convert.IsDBNull(dataReader["Target"]) ? null : dataReader["Target"] as int?; 
        }
	    public MessageCenterEntity()
        {
            ID = 0;
            MessageType = null;
            MessageContent = null;
            SendDate = null;
            ReadDate = null;
            Opation = null;
            OpationDate = null;
            FromSource = null;
            Target = null;
        }
	}
}
